<%-- 
    Document   : managerUser
    Created on : Sep 3, 2014, 10:45:04 AM
    Author     : thanhap
--%>
<%@page import="java.util.List"%>
<%@page import="bo2s.data.User"%>
<%@page import="bo2s.DAO.UserDAO"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertTemplate template="/template_admin/TempalteAdmin.jsp">

        <tiles:putAttribute name="titleAdmin">
           Manager User
	</tiles:putAttribute>
    
	<tiles:putAttribute name="contentadmin">
            <div class="container-fluid">
            <div class="row">
                    <div class="col-lg-12">
                        <ol class="breadcrumb">
                            <li class="active">
                                <i class="fa fa-dashboard"></i> Table User :
                            </li>
                        </ol>
                    </div>
                </div>
                <!-- /.row -->

                <div class="row">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <div class="row">
                                            <table class="table">
                    <thead>
                    <tr>
                        <th>User ID</th>
                        <th>User Name</th>
                        <th>Password</th>
                        <th>Full Name</th>
                        <th>Email</th>
                        <th>Phone</th>
                        <th>Address</th>
                        <th>Gender</th>
                        <th>Image</th>
                        <th>Role</th>
                    </tr>
                </thead>
                <tbody>
                    <%
                        UserDAO eb = new UserDAO();
                        List<User> list = eb.getUseres();
                        for (User e : list) {
                    %>
 
                    <tr>
                        <td><%=String.valueOf(e.getId())%></td>
                        <td><%=e.getUsername()%></td>
                        <td><%=e.getPassword()%></td>
                        <td><%=e.getFullname()%></td>
                        <td><%=e.getEmail()%></td>
                        <td><%=e.getPhone()%></td>
                        <td><%=e.getAddress()%></td>
                        <td><%=e.getGender()%></td>
                        <td><%=e.getImage()%></td>
                        <td><%=String.valueOf(e.getRole())%></td>
                        <td style="border: none;">
                            <div>
                                <form method="post" action="userupdate.jsp">
                                    <input type="hidden" id="updateid" name="updateid" value="<%=String.valueOf(e.getId())%>"/> 
                                    <input class="btn" type="submit" value="Modify..."/> 
                                </form>
                            </div>
                        </td>
                        <td style="border: none;">
                            <div>
                                <form method="post" action="${pageContext.request.contextPath}/DeleteServlet">
                                    <input type="hidden" id="delId" name="delid" value="<%=String.valueOf(e.getId())%>"/> 
                                    <input class="btn" type="submit" value="Delete"/> 
                                </form>
                            </div>
                        </td>
                    </tr>
                    <%
                        }
                    %>
                </tbody>
            </table>       
                                </div>
                            </div>
                                <div class="panel-footer">
                                    <span><%@include file="adminmanager.jsp"%></span>
                                    <div class="clearfix"></div>
                                </div>
                        </div>
                    </div>
                    
                <!-- /.row -->
                    </div>
	</tiles:putAttribute> 
            
	
</tiles:insertTemplate>
